Sat Mar 10 15:49:10 2001
This directory was created by:

(1) Unpack the 4.1 distribution

    -rw-rw-r--    1 beebe    staff      664562 Sep 21  1998 ../lcc-4.1.tar.gz

    and then rename the directory from lcc-4.1 to lcc-4.1.beta.4.

(2) Add write permission to the tree:

	chmod -R ug+w .

    Several files are otherwise write protected, which would cause the
    update in the next step to fail.

(3) Run the newly-updated ./wget.sh script (not part of the
    distribution; created by editing

	http://www.cs.princeton.edu/software/lcc/cgi-bin/changed.cgi

    into this script); this fetches new versions of these files:

	% find . -mtime -1 | sort
	./CPYRIGHT
	./alpha/osf/tst/cq.sbk
	./alpha/osf/tst/yacc.2bk
	./alpha/osf/tst/yacc.sbk
	./doc/4.html
	./doc/install.html
	./etc/bprint.c
	./etc/irix.c
	./etc/lcc.c
	./lib/bbexit.c
	./linux.mk
	./osf.mk
	./solaris.mk
	./src/c.h
	./src/dag.c
	./src/dagcheck.md
	./src/decl.c
	./src/enode.c
	./src/expr.c
	./src/prof.c
	./src/profio.c
	./src/simp.c
	./src/stmt.c
	./src/tree.c
	./src/x86.md
	./src/x86linux.md
	./tst/yacc.c
	./x86/linux/tst/8q.sbk
	./x86/linux/tst/array.sbk
	./x86/linux/tst/cf.sbk
	./x86/linux/tst/cq.sbk
	./x86/linux/tst/cvt.sbk
	./x86/linux/tst/fields.sbk
	./x86/linux/tst/front.sbk
	./x86/linux/tst/incr.sbk
	./x86/linux/tst/init.sbk
	./x86/linux/tst/limits.sbk
	./x86/linux/tst/paranoia.1bk
	./x86/linux/tst/paranoia.sbk
	./x86/linux/tst/sort.sbk
	./x86/linux/tst/spill.sbk
	./x86/linux/tst/stdarg.sbk
	./x86/linux/tst/struct.sbk
	./x86/linux/tst/switch.sbk
	./x86/linux/tst/wf1.sbk
	./x86/linux/tst/yacc.2bk
	./x86/linux/tst/yacc.sbk

(4) Copy in an updated etc/linux.c script with these changes (needed
    to reflect recent gcc releases, and Red Hat 6.x or later):

5c5
< static char rcsid[] = "$Id: README.UTAH,v 1.1.1.1 2002/04/21 13:25:05 peter Exp $";
---
> static char rcsid[] = "$Id: README.UTAH,v 1.1.1.1 2002/04/21 13:25:05 peter Exp $";
10a11,19
> #ifndef GCCDIR
> #define GCCDIR "/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/"
> #endif
>
> #ifndef LIBDIR
> #define LIBDIR "/usr/lib/"
> #endif
>
>
13c22
< char *cpp[] = { LCCDIR "gcc/cpp",
---
> char *cpp[] = { LCCDIR "cpp",
16c25,33
< 	"-D__unix__", "-D__i386__", "-D__linux__", "-D__signed__=signed",
---
> 	"-D__unix__", "-D__i386__", "-D__linux__",
>
> 	/* These gcc-specific symbols confuse lcc: define them differently */
> 	"-D__gnuc_va_list=char*",
> 	"-D__NORETURN=",
> 	"-D__NORETURN2=",
> 	"-D__CONSTVALUE=",
> 	"-D__CONSTVALUE2=",
>
18c35
< char *include[] = {"-I" LCCDIR "include", "-I" LCCDIR "gcc/include", "-I/usr/include", 0 };
---
> char *include[] = {"-I" LCCDIR "include", "-I/usr/include", "-I/usr/i386-glibc20-linux/include", 0 };
24,25c41
< 	/*  7 */ "/usr/lib/crt1.o", "/usr/lib/crti.o",
< 	/*  9 */ LCCDIR "/gcc/crtbegin.o",
---
> 	/*  7 */ LIBDIR "/crt1.o", LIBDIR "/crti.o", GCCDIR "crtbegin.o",
29,31c45,46
< 	/* 14 */ "-L" LCCDIR "/gcc", "-lgcc", "-lc", "-lm",
< 	/* 18 */ "",
< 	/* 19 */ LCCDIR "/gcc/crtend.o", "/usr/lib/crtn.o",
---
> 	/* 14 */ "", "", "-lc", "-lm",
> 	/* 18 */ "", GCCDIR "crtend.o", LIBDIR "/crtn.o",
38c53
< 		cpp[0] = concat(&arg[8], "/gcc/cpp");
---
> 		cpp[0] = concat(&arg[8], "/cpp");
40,44c55
< 		include[1] = concat("-I", concat(&arg[8], "/gcc/include"));
< 		ld[9]  = concat(&arg[8], "/gcc/crtbegin.o");
< 		ld[12] = concat("-L", &arg[8]);
< 		ld[14] = concat("-L", concat(&arg[8], "/gcc"));
< 		ld[19] = concat(&arg[8], "/gcc/crtend.o");
---
> 		ld[12] =  concat("-L", &arg[8]);
47c58
< 		ld[7] = "/usr/lib/gcrt1.o";
---
> 		ld[7] = LIBDIR "/gcrt1.o";
57a69,70
> 	        ld[14] = "-L/usr/lib/gcc-lib/i486-linux/2.7.2";
> 	        ld[15] = "-lgcc";

(5) Copy in the ../lcc-4.1.beta.3/BUILD-LCC.sh script and update its
    line 4 to read

	VERSION=lcc-4.1.beta.4

    and at line 176

	CFLAGS='-DNATIVEDIR=\"/opt/SUNWspro/WS6U1/lib/\" '"$CFLAGS"

(6) Copy in the ../lcc-4.1.beta.2/etc/sparc-linux.c file to ./etc

(7) Make sure src/dag.c says on line 5:

	#define kill Kill			/* avoid collision with symbol in <signal.h> */

    This patch was reported to the lcc developers, but has not yet
    made it into the master distribution.

(8) Copy the tree to /local/build and run

	./BUILD-LCC.sh

    to build and install the new compiler.  On Intel x86, there are
    LOTS of warnings, and difference reports.  I simply ignore them:
    the test suite is seriously out of date, sigh...

(9) Supply a missing symlink:

	ln -s $L/lib/gcc-lib/i686-pc-linux-gnu/2.95.2 /usr/local/lib/lcc-4.1.beta.4/gcc

lcc installation is now complete!
------------------------------------------------------------------------
Tue Mar 13 17:54:58 2001

I found that configure failed when the Portland Group compilers pgcc
or pgCC were selected.  This was traced to their outputting a message
"Linking:" on stdout instead of stderr, confusing config.sub when it
called config.guess.  The solution proved to be to modify config.guess
to discard stdout as well as stderr in several places.  The bug has
been reported to the autoconf maintainers.

------------------------------------------------------------------------
Tue Mar 13 17:57:06 2001

A build with the Portland Group compiler pgcc failed in src/types.c,
because that code uses LDBL_MAX in the statement

	p->u.limits.max.d = LDBL_MAX;

which expands to

	p->u.limits.max.d = ( ( ( union __convert_long_double ) {
		__convert_long_double_i : { 0xffffffff , 0xffffffff , 0x107ffe
		, 0x0 } } ) . __convert_long_double_d ) ;

and pgcc doesn't support a long double type.

That is the only source file that would not compile with that
compiler.  It looks to me like use of that type ought to be
parametrized to suppress its use at bootstrap time in the local
compiler does not support it.
------------------------------------------------------------------------
Thu Mar 15 07:08:06 2001

A build in a different directory from the lcc distribution tree is
now supported, and can be done like this:

	/path/to/lcc/distribution/configure && make all check install

It creates only these files in the current directory:

	config.cache
	config.log
	config.status
	lcc-conf.h
	Makefile

Nothing is touched in the lcc distribution tree, so it can be on
read-only media, such as CD-ROM or DVD, or used for simultaneous
builds on multiple architectures sharing a common file system.

The compiled files are placed in builddir (reported at the end of the
configure run); it is usually something like this (from "make
show-setup"):

	...
	builddir        = /usr/tmp/lcc/4.1.beta.6/x86-linux
	...

Notice that it contains the target name in the last component.  Thus,
even if you were to force a common build tree by, e.g.,

	env BUILDDIR=$HOME/tmp \
		/path/to/lcc/distribution/configure &&
			make all check install

you could run simultaneous builds without conflicts, AS LONG AS the
directory where you run configure is different for each build, since
the five files above that are created are different for each platform.
------------------------------------------------------------------------

